<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/* Author: Duc Nhat
 * Description: Home model class
 */
class Log_model extends CI_Model{
	
	var $id_action = null;
	var $date_log = null;
	var $id_user = null;
	var $comment_log = null;
	
	function __construct(){
		parent::__construct();
		$this->load->database();
		date_default_timezone_set('Asia/Ho_Chi_Minh');
	}
		
	function saveLog($_id_action, $_date_log = null, $_id_user = null, $_comment_log){
		if($_date_log == null) 
			$_date_log = date("Y-m-d H:i:s");
		if($_id_user == null)
			$_id_user = $this->session->userdata('user_id');
		$data = array(
				"action_log_vtv4" => $_id_action,
				"date_log_vtv4" => $_date_log,
				"id_nguoidung_vtv4_pk" => $_id_user,
				"comment_log_vtv4" => $_comment_log
				); 
		return $this->db->insert("vtv4_log",$data);
	}
}